using System;
using System.Threading.Tasks;
internal class ASyncSmaple_03 {
    private static Guid GetGuid () {
        var temp = Guid.NewGuid ();
        return temp;
    }
    public async Task GetGuidAsync () {
        Console.WriteLine("----------ASyncSmaple_03 : 异步方法开始------------" );
        var myFunc = new Func<Guid> (GetGuid);
        var t1 = await Task.Run (myFunc);
        var t2 = await Task.Run (new Func<Guid> (GetGuid));
        var t3 = await Task.Run (() => GetGuid ());
        var t4 = await Task.Run (() => Guid.NewGuid ());

        Console.WriteLine ("T1:{0}", t1);
        Console.WriteLine ("T2:{0}", t2);
        Console.WriteLine ("T3:{0}", t3);
        Console.WriteLine ("T4:{0}", t4);

        Console.WriteLine("----------ASyncSmaple_03 : 异步方法结束-------------" );
    }
}